﻿package net.area80.serverside
{
	import net.area80.Area80;
	
	/**
	* ServerSide
	* @author Wissarut Pimanmassuriya
	*/
	public class ServerSide
	{
		public static const DATATYPE_ERROR:String = "error";
		public static const DATATYPE_RECIEVED_DATA:String = "recieveddata";
		public static const DATATYPE_DEFAULT:String = "default";
		
		public static var useTestPath:Boolean = false;
		public static var cacheKill:Boolean = true;
		public static var displayErrorMessage:Boolean = true;
		public static var displayRecievedData:Boolean = true;
		public static var displayRegularMessage:Boolean = true;
		
		public static var VERBOSE:Boolean = true;

		public static function log (message:String, dataType:String = ""):void {
			if (VERBOSE) {
				switch (dataType) {
					case DATATYPE_ERROR :
					if (displayErrorMessage) Area80.log("Serverside => Error:" + message);
					break;
					case displayRecievedData :
					if (displayRecievedData) Area80.log( "Serverside => Recieved Data:" + message);
					default :
					if (displayRegularMessage) Area80.log("Serverside => " + message);
					break;
				}
			}
			
		}
	}
}